package com.spring.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.UUID;

/**
 * Description:
 *
 * @author lijie
 * @create 2019-01-20 9:56
 * Update by lijie 2019-01-20 9:56
 */
@Repository
public class UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insert(){
        String sql = "INSERT INTO user(name,age) VALUES(?,?);";
        String name = UUID.randomUUID().toString().substring(0, 5);
        jdbcTemplate.update(sql,name,19);
        System.out.println("插入陈宫...dao");
        int j = 10/0;
    }
}
